import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;


import java.util.ArrayList;

public class BROWSE extends Contronller{
        public static void Browse() {
        FlowPane flowPane = new FlowPane();
        Scene scene = new Scene(flowPane,300,120);
        Stage stage = new Stage();
        stage.setScene(scene);
        stage.setTitle("All Staff");
        int len = Main.staffList.size();
        Label[] labels = new Label[len];
        flowPane.setOrientation(Orientation.HORIZONTAL);
        flowPane.setHgap(20);
        flowPane.setVgap(10);

        for (int i = 0; i < len; i++){
                labels[i] = new Label(Main.staffList.get(i).getName());
        }
        flowPane.getChildren().addAll(labels);
        Button back = new Button("Back");
        flowPane.getChildren().add(back);
        back.setOnAction(event -> {
                stage.close();
        });
        stage.show();
        }
}
